<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var xhr = new XMLHttpRequest()
        xhr.open('GET', 'http://127.0.0.1:3000/json')
        // var data = JSON.stringify(obj);
        // xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8')
        // xhr.send(data);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4) {
                var data = JSON.parse(xhr.responseText);
                console.log(data);
            }
        }
        xhr.send();
    </script>
</body>

</html>